let iframePostMessage = {}
iframePostMessage.saveToken = (access_token) => {
    document.getElementById('token_iframe')
        .contentWindow.postMessage({ type: 1, token: access_token },
            window.appConfig.common_iframe)
}
iframePostMessage.getToken = (access_token) => {
    document.getElementById('token_iframe')
        .contentWindow.postMessage({ type: 2 },
            window.appConfig.common_iframe)
    window.addEventListener('message', function (event) {
        if (event.data.type == 2) {
            console.log(event.data.token)
        }
    }, false);
}
export default iframePostMessage